package com.spa.infrastructure.enums.dict;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.spa.infrastructure.annotation.SysDictEnumAnnotation;
import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
@SysDictEnumAnnotation(key = "Source", desc = "团购券来源")
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum SourceEnum implements IBaseEnum {

    $1(1, "抖音团购券",1,0),
    ;
    private Integer code;
    private String desc;
    //排序
    private Integer sort;
    //状态  0 启用  1 不启用
    private Integer status;

    public static SourceEnum byCode(int code) {
        for (SourceEnum value : values()) {
            if (value.code == code) return value;
        }
        return null;
    }

}
